import request from '@/utils/request'
import { commonBaseUrl } from '@/utils'

const moduleName = commonBaseUrl('D')
//
export function getList(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/getSiteService',
        params
    })
}
export function getListNew(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/getSiteService',
        params
    })
}
// 查询站址服务（重构）
export function getSiteService(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/getSiteServiceNew',
        method: 'post',
        data: params
    })
}

// 查询明细
export function getDetails(data) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/canSelectedServiceDetailList',
        method: 'post',
        data
    })
}

// 查询添加配置列表
export function getSelectedServiceDetailList(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/selectedServiceDetailList',
        params
    })
}

// 配置详情添加
export function addMaterialDetail(data, url) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/' + url,
        method: 'post',
        data,
      showLoading: true
    })
}

// 配置详情删除
export function deleteMaterialDetail(data, url) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/' + url,
        method: 'post',
        data,
      showLoading: true
    })
}

// 保存校验
export function verifySaveServiceDetailsData(data) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/verifySaveServiceDetailsData',
        method: 'post',
        data
    })
}

// 保存
export function saveDetails(data, url) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/' + url,
        method: 'post',
        data,
      showLoading: true
    })
}

// 确认
export function saveDetailVerify(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/saveDetailVerify',
        method: 'post',
        params,
      showLoading: true
    })
}

// 服务明细配置确认并推送财务按钮操作（重构）
export function saveDetailVerifyNew(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/saveDetailVerifyNew',
        method: 'post',
        data: params,
      showLoading: true
    })
}

// 销项确认
export function saveDetailVerifyRevocation(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/saveDetailVerifyRevocation',
        method: 'post',
        params
    })
}

// 项目下存在累计验工计价为0但已配置了明细的服务
export function getSumMoneyIsNull(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/getSumMoneyIsNull',
        params,
      showLoading: true
    })
}

// 项目下存在累计验工计价为0但已配置了明细的服务（重构）
export function getSumMoneyIsNullNew(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/getSumMoneyIsNullNew',
        method: 'post',
        data: params,
      showLoading: true
    })
}

// 项目项目下存在累计验工计价为0但已配置了明细的服务，请确认是否删除明细？确认后在PC端添加的服务明细将自动删除
export function deleteAllUselessDetail(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/deleteAllUselessDetail',
        method: 'post',
        params,
      showLoading: true
    })
}

// 项目项目下存在累计验工计价为0但已配置了明细的服务，请确认是否删除明细？确认后在PC端添加的服务明细将自动删除(重构)
export function deleteAllUselessDetailNew(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/deleteAllUselessDetailNew',
        method: 'post',
        data: params,
      showLoading: true
    })
}

// 销项项目项目下存在累计验工计价为0但已配置了明细的服务，请确认是否删除明细？确认后在PC端添加的服务明细将自动删除
export function deleteAllUselessDetail4(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/deleteRevocationAllUselessDetail',
        method: 'post',
        params,
      showLoading: true
    })
}

// 配置明细初始化
export function initServiceDetailData(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/initServiceDetailData',
        method: 'post',
        params
    })
}

// 配置明细初始化（重构）
export function initServiceDetailDataNew(params) {
    return request({
        url: moduleName + 'api/service/serviceDetailConfig/initServiceDetailDataNew',
        method: 'post',
        data: params
    })
}

// 是否是试点标识
export function isPilotProject(params) {
    return request({
        // isPilotProject
        url: moduleName + 'api/pub/material/isNeedSerDetailsLabel',
        params
    })
}
// 是否白名单项目
export function isWhitePrjApi(params) {
    return request({
        url: moduleName + 'api/pub/material/isWhitePrj',
        params
    })
}

// 试点白名单合并接口，实现多个项目同时判断
export function servDetailPrjsCheck(params) {
    return request({
        url: moduleName + 'api/pub/material/servDetailPrjsCheck',
        method: 'post',
        data: params
    })
}

// 是否可打开物资退库
export function beforeInquiryJumpApi(params) {
    return request({
        url: moduleName + 'api/pub/enquiry/beforeInquiryJump',
        showLoading: true,
        params
    })
}

